import request from "@/utils/request";
/**
 * 我的消息
 */
export function getReplies(pageRequest) {
    return request({
        url: '/message/getRepliesByUser',
        method: 'GET',
        params: {
            ...pageRequest
        }
    })
}
// export function getReplies(toUid) {
//     return request({
//         url: '/message/getReplyBytoUid',
//         method: 'GET',
//         params: {
//             toUid
//         }
//     })
// }
//修改状态为已读
export function updateViewedReplies(){
    return request({
        url:'/message/updateViewedReplies',
        method:'post'
    })
}

/**
 * 我的帖子
 * @returns {*}
 */
export function getMyPost(orderByCommentCount, currentPage, pageSize) {
    return request({
        url: '/message/myPost',
        method: 'POST',
        data: {
            orderByCommentCount,
            currentPage,
            pageSize,
        }
    })
}

/**
 *组队申请 
 */
//获取发出的队伍申请
export function getAllRegistrationsByUid({ current, size }) {
    return request({
        url: '/message/getAllRegistrationsByUid',
        method: 'post',
        params: { current, size }
    })
}
//获取申请详情
export function getOneRegistration(riId) {
    return request({
        url: '/message/getOneRegistration',
        method: 'post',
        params: riId
    })
}
//修改申请信息
export function modifyRegistration(registrationInformation) {
    return request({
        url: '/message/modifyRegistration',
        method: 'post',
        data: registrationInformation

    })
}
//取消申请信息
export function cancelRegistration(riId) {
    return request({
        url: '/message/cancelRegistration',
        method: 'post',
        params: riId
    })
}
//组队申请设为已读
export function updateViewedRegistrations(){
    return request({
        url:'/message/updateViewedRegistrations',
        method:'post',
    })
}

//新消息
export function getNotReadMessage() {
    return request({
        url: '/message/getNotReadMessage',
        method: 'get',
    })
}
